//login.js
import request from '@/utils/request'
// 引入qs库，qs.stringify()可以将对象转成字符串形式，这是因为后台接口的要求，一般来说axios传入data对象即可
import qs from 'qs'

export function doLogin (username, password) {
  let data = {
    username,
    password
  }
  data = qs.stringify(data)
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}
export function giteeLogin () {
  
  return request({
    url: '/oauth/authorize?client_id=4878a2809400a5701e952d2b5e6327b4f10c3eca0f73352e8aa3f11b6c7a5fae&redirect_uri=http://localhost:9090/user/oauth2&response_type=code',
    method: 'get'
  })

}
export function logout () {
  return request({
    url: '/user/logout',
    method: 'post'
  })
}
